package com.lfz.quality_effect.utils;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class LogUtils {
   public static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");




    public static void write(String content){
        File f=new File(System.getProperty("user.dir")+File.separator+simpleDateFormat.format(new Date())+"-log.txt");

        try
        {
            //BufferedWriter for performance, true to set append to file flag
            BufferedWriter buf = new BufferedWriter(new FileWriter(f, true));
            buf.append(content);
            buf.newLine();
            buf.close();
        }
        catch (IOException e)
        {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }
}
